const STATIC_VARIABLE_MAP = new Map();
const { hostname } = window.location;
const test = /test|172|192/.test(hostname);

STATIC_VARIABLE_MAP.set('IMG_PREFIX_URL', 'http://img.fufentong.com');
STATIC_VARIABLE_MAP.set('API_PREFIX_URL', test ? 'http://localhost:7001' : 'http://localhost:7001');
STATIC_VARIABLE_MAP.set(
  'FILE_URL',
  test ? 'http://test.houtaiapi.fufentong.com' : 'https://file.api.fufentong.com',
); // 表格上传URL
STATIC_VARIABLE_MAP.set('PRICE', function (val) {
  let price = parseInt(val) / 100;
  if (isNaN(price)) {
    return '0.00';
  } else {
    return price.toFixed(2);
  }
});

export const GLOBAL_AUTH_INFO = 'WAREHOUSE_LOGIN_INFO';

export default STATIC_VARIABLE_MAP;
